package com.danco.training.zaneuskaya.view;



import com.danco.training.zaneuskaya.view.action.booklist.CreateBookAction;
import com.danco.training.zaneuskaya.view.action.booklist.DeleteBookAction;
import com.danco.training.zaneuskaya.view.action.booklist.PrintAvailableBookListAction;
import com.danco.training.zaneuskaya.view.action.booklist.PrintBookListAction;
import com.danco.training.zaneuskaya.view.action.booklist.PrintNotAvailableBookListAction;
import com.danco.training.zaneuskaya.view.action.booklist.ReadBookListFromFileAction;
import com.danco.training.zaneuskaya.view.action.booklist.SaveBookListToFileAction;
import com.danco.training.zaneuskaya.view.action.booklist.ShowBookInfoAction;
import com.danco.training.zaneuskaya.view.action.booklist.SortBookListByAlphabetAction;
import com.danco.training.zaneuskaya.view.action.booklist.SortBookListByPriceAction;
import com.danco.training.zaneuskaya.view.action.booklist.SortBookListByPublicationDateAction;
import com.danco.training.zaneuskaya.view.action.booklist.SortUnsoldBookListByPriceAction;
import com.danco.training.zaneuskaya.view.action.booklist.SortUnsoldBookListByReceiptDateAction;
import com.danco.training.zaneuskaya.view.action.booklist.UpdateBookAction;
import com.danco.training.zaneuskaya.view.action.claimlist.CreateClaimAction;
import com.danco.training.zaneuskaya.view.action.claimlist.DeleteClaimAction;
import com.danco.training.zaneuskaya.view.action.claimlist.PrintClaimListAction;
import com.danco.training.zaneuskaya.view.action.claimlist.ReadClaimListFromFileAction;
import com.danco.training.zaneuskaya.view.action.claimlist.SaveClaimListToFileAction;
import com.danco.training.zaneuskaya.view.action.claimlist.ShowClaimInfoAction;
import com.danco.training.zaneuskaya.view.action.claimlist.SortClaimListByAlphabetAction;
import com.danco.training.zaneuskaya.view.action.claimlist.SortClaimListByClaimAmountAction;
import com.danco.training.zaneuskaya.view.action.claimlist.UpdateClaimAction;
import com.danco.training.zaneuskaya.view.action.orderlist.AddBookToOrderAction;
import com.danco.training.zaneuskaya.view.action.orderlist.CopyOrderAction;
import com.danco.training.zaneuskaya.view.action.orderlist.CreateOrderAction;
import com.danco.training.zaneuskaya.view.action.orderlist.DeleteBookFromOrderAction;
import com.danco.training.zaneuskaya.view.action.orderlist.ExecuteOrderAction;
import com.danco.training.zaneuskaya.view.action.orderlist.PrintExecutedOrderList;
import com.danco.training.zaneuskaya.view.action.orderlist.PrintOrderListAction;
import com.danco.training.zaneuskaya.view.action.orderlist.ReadOrderListFromFileAction;
import com.danco.training.zaneuskaya.view.action.orderlist.RejectOrderAction;
import com.danco.training.zaneuskaya.view.action.orderlist.SaveOrderListToFileAction;
import com.danco.training.zaneuskaya.view.action.orderlist.ShowOrderInfoAction;
import com.danco.training.zaneuskaya.view.action.orderlist.SortExecutedOrderListByOrderDateAction;
import com.danco.training.zaneuskaya.view.action.orderlist.SortExecutedOrderListByPriceAction;
import com.danco.training.zaneuskaya.view.action.orderlist.SortOrderListByOrderDateAction;
import com.danco.training.zaneuskaya.view.action.orderlist.SortOrderListByPriceAction;
import com.danco.training.zaneuskaya.view.action.orderlist.UpdateOrderAction;

public class Creator {

	private Menu mainMenu;

	public void createMenu(){
		mainMenu = new Menu();
		Menu menu1 = new Menu();
		Menu menu2 = new Menu();
		Menu menu3 = new Menu();
		
		Menu menu11 = new Menu();
		Menu menu21 = new Menu();
		Menu menu31 = new Menu();
		
		
		MenuItem menuItem311 = new MenuItem(new SortOrderListByOrderDateAction(),"Sort order list by execution date", menu31);
		MenuItem menuItem312 = new MenuItem(new SortOrderListByPriceAction(),"Sort order list by total price", menu31);
		MenuItem menuItem313 = new MenuItem(new PrintExecutedOrderList(),"Show executed orders", menu31);
		MenuItem menuItem314 = new MenuItem(new SortExecutedOrderListByOrderDateAction(),"Sort executed orders by execution date ", menu31);
		MenuItem menuItem315 = new MenuItem(new SortExecutedOrderListByPriceAction(),"Sort executed orders by total price", menu31);
		MenuItem menuItem316 = new MenuItem(new PrintOrderListAction(),"Quit", menu3);
		
		MenuItem menuItem211 = new MenuItem(new SortClaimListByAlphabetAction(),"Sort claim list by alphabet", menu21);
		MenuItem menuItem212 = new MenuItem(new SortClaimListByClaimAmountAction(),"Sort claim list by claim amount", menu21);
		MenuItem menuItem213 = new MenuItem(new PrintClaimListAction(),"Quit", menu2);
		
		
		MenuItem menuItem111 = new MenuItem(new SortBookListByAlphabetAction(),"Sort book list by alphabet", menu11);
		MenuItem menuItem112 = new MenuItem(new SortBookListByPublicationDateAction(),"Sort book list by publication date", menu11);
		MenuItem menuItem113 = new MenuItem(new SortBookListByPriceAction(),"Sort book list by price", menu11);
		MenuItem menuItem114 = new MenuItem(new PrintAvailableBookListAction(),"Show available books ", menu11);
		MenuItem menuItem115 = new MenuItem(new PrintNotAvailableBookListAction(),"Show not available books", menu11);
		MenuItem menuItem116 = new MenuItem(new SortUnsoldBookListByReceiptDateAction(),"Sort unsold books by receipt date", menu11);
		MenuItem menuItem117 = new MenuItem(new SortUnsoldBookListByPriceAction() ,"Sort unsold books by price", menu11);
		MenuItem menuItem118 = new MenuItem(new PrintBookListAction(),"Quit", menu1);
		
		MenuItem menuItem31 = new MenuItem(new PrintOrderListAction(),"Sort order list", menu31);
		MenuItem menuItem32 = new MenuItem(new AddBookToOrderAction(), "Add books to order ", menu3);
		MenuItem menuItem33 = new MenuItem(new DeleteBookFromOrderAction(), "Delete book from order", menu3);
		MenuItem menuItem34 = new MenuItem( new ShowOrderInfoAction(), "View order info", menu3);
		MenuItem menuItem35 = new MenuItem(new CreateOrderAction(), "Add order", menu3);
		MenuItem menuItem36 = new MenuItem(new ExecuteOrderAction(), "Execute order", menu3);
		MenuItem menuItem37 = new MenuItem(new RejectOrderAction(), "Reject order", menu3);
		MenuItem menuItem38 = new MenuItem(new UpdateOrderAction(), "Update order", menu3);
		MenuItem menuItem39 = new MenuItem(new CopyOrderAction(), "Create order copy", menu3);
		MenuItem menuItem40 = new MenuItem(new SaveOrderListToFileAction(), "Save order list to file", menu3);
		MenuItem menuItem41 = new MenuItem(new ReadOrderListFromFileAction(), "Read order list from file", menu3);
		MenuItem menuItem30 = new MenuItem(new PrintOrderListAction(), "Quit", mainMenu);
	
		
		MenuItem menuItem21 = new MenuItem(new PrintClaimListAction(),"Sort claim list", menu21);
		MenuItem menuItem22 = new MenuItem(new CreateClaimAction(), "Add claim ", menu2);
		MenuItem menuItem23 = new MenuItem(new DeleteClaimAction(), "Delete claim", menu2);
		MenuItem menuItem24 = new MenuItem(new ShowClaimInfoAction(), "View claim info", menu2);
		MenuItem menuItem25 = new MenuItem(new UpdateClaimAction(), "Update claim", menu2);
		MenuItem menuItem26 = new MenuItem(new SaveClaimListToFileAction(), "Save claim list to file", menu2);
		MenuItem menuItem27 = new MenuItem(new ReadClaimListFromFileAction(), "Read claim list from file", menu2);
		MenuItem menuItem28 = new MenuItem( new PrintClaimListAction(), "Quit", mainMenu);
		
		MenuItem menuItem11 = new MenuItem(new PrintBookListAction(),"Sort book list", menu11);
		MenuItem menuItem12 = new MenuItem(new CreateBookAction(), "Add book", menu1);
		MenuItem menuItem13 = new MenuItem(new DeleteBookAction(), "Delete book", menu1);
		MenuItem menuItem14 = new MenuItem(new ShowBookInfoAction(), "View book info", menu1);
		MenuItem menuItem15 = new MenuItem(new UpdateBookAction(), "Update book", menu1);
		MenuItem menuItem16 = new MenuItem(new SaveBookListToFileAction(), "Save book list to file", menu1);
		MenuItem menuItem17 = new MenuItem(new ReadBookListFromFileAction(), "Read book list from file", menu1);
		MenuItem menuItem18 = new MenuItem(new PrintBookListAction(), "Quit", mainMenu);
		
		
		menu31.addMenuItem(menuItem311);
		menu31.addMenuItem(menuItem312);
		menu31.addMenuItem(menuItem313);
		menu31.addMenuItem(menuItem314);
		menu31.addMenuItem(menuItem315);
		menu31.addMenuItem(menuItem316);
		
		
		menu21.addMenuItem(menuItem211);
		menu21.addMenuItem(menuItem212);
		menu21.addMenuItem(menuItem213);
		
		
		
		menu11.addMenuItem(menuItem111);
		menu11.addMenuItem(menuItem112);
		menu11.addMenuItem(menuItem113);
		menu11.addMenuItem(menuItem114);
		menu11.addMenuItem(menuItem115);
		menu11.addMenuItem(menuItem116);
		menu11.addMenuItem(menuItem117);
		menu11.addMenuItem(menuItem118);
		
		menu3.addMenuItem(menuItem31);
		menu3.addMenuItem(menuItem32);
		menu3.addMenuItem(menuItem33);
		menu3.addMenuItem(menuItem34);
		menu3.addMenuItem(menuItem35);
		menu3.addMenuItem(menuItem36);
		menu3.addMenuItem(menuItem37);
		menu3.addMenuItem(menuItem38);
		menu3.addMenuItem(menuItem39);
		menu3.addMenuItem(menuItem40);
		menu3.addMenuItem(menuItem41);
		menu3.addMenuItem(menuItem30);
		
		
		menu1.addMenuItem(menuItem11);
		menu1.addMenuItem(menuItem12);
		menu1.addMenuItem(menuItem13);
		menu1.addMenuItem(menuItem14);
		menu1.addMenuItem(menuItem15);
		menu1.addMenuItem(menuItem16);
		menu1.addMenuItem(menuItem17);
		menu1.addMenuItem(menuItem18);
		
		menu2.addMenuItem(menuItem21);
		menu2.addMenuItem(menuItem22);
		menu2.addMenuItem(menuItem23);
		menu2.addMenuItem(menuItem24);
		menu2.addMenuItem(menuItem25);
		menu2.addMenuItem(menuItem26);
		menu2.addMenuItem(menuItem27);
		menu2.addMenuItem(menuItem28);
		
		MenuItem menuItem1 = new MenuItem (new PrintBookListAction(), "Print book list" , menu1);
		MenuItem menuItem2 = new MenuItem (new PrintClaimListAction(), "Print claim list" , menu2);
		MenuItem menuItem3 = new MenuItem (new PrintOrderListAction(), "Print order list" , menu3);
		MenuItem menuItem4 = new MenuItem (new PrintBookListAction(), "Quit" , null);
		
		mainMenu.addMenuItem(menuItem1);
		mainMenu.addMenuItem(menuItem2);
		mainMenu.addMenuItem(menuItem3);
		mainMenu.addMenuItem(menuItem4);
		
	}

	public Menu getMainMenu() {
		return this.mainMenu;

	}

}
